// define port
var port = 8088;

// define context path
var contextPath = '/O2OFileServer';

var express = require('express');
var http = require('http');
var bodyParser = require('body-parser');

var app = express();
var router = express.Router();

require('./routes/read.route')(router);
require('./routes/write.route')(router);

app.use(bodyParser.json({limit: '50mb'}));
app.use(bodyParser.urlencoded({limit: '50mb', extended: true}));

app.use(contextPath, router);

var server = http.createServer(app);

server.listen(port, function() {
    console.log('server started at port: ' + port);
});